package com.qire.manhua.controller;

import android.view.View;

import com.qire.antsrouter.AntsRouter;
import com.qire.common.constant.Navigation;
import com.qire.common.support.base.EventController;
import com.qire.manhua.activity.TeensModeToggleActivity;
import com.qire.manhua.databinding.ActivityTeensModeToggleBinding;
import com.qire.manhua.model.viewModel.impl.TeensModeToggleViewModel;

import androidx.annotation.NonNull;

public class TeensModeToggleController extends EventController<TeensModeToggleActivity> {

    private TeensModeToggleViewModel viewModel;

    public TeensModeToggleController(@NonNull TeensModeToggleActivity lifecycleOwner) {
        super(lifecycleOwner);
    }

    @Override
    protected void bindView() {
        ActivityTeensModeToggleBinding viewDataBinder = owner.viewDataBinder();
        viewDataBinder.setTeensModeToggleController(this);
    }

    @Override
    protected void onCleared() {
        super.onCleared();
        this.viewModel = null;
    }

    public void onAddition(TeensModeToggleViewModel viewModel) {
        this.viewModel = viewModel;
    }

    /*************************************************************************************************************************/

    /** 退出按钮事件响应 */
    public void backBtnOnClick(View view) {
        owner.onBackPressed();
    }

    public void nextBtnOnClick(View view) {
        viewModel.nextAction();
    }

    public void retrievePasswordBtnOnClick(View view) {
        AntsRouter.ROUTER.buildCard(Navigation.Page.TeensRetrievePasswordPage).navigation();
    }

}
